package com.neuedu.methods;

public class MethodOverload {

    /**
     * 用于两个数字加和
     * @param numa  第一个数字
     * @param numb  第二个数字
     *  @return   加和的结果
     *
     *  CTRL  + Q
     */
    public static int sum(int numa ,int numb){
        System.out.println("整数相加");
        return  numa + numb;
    }

    public static double sum(double dnuma ,double dnumb){
        System.out.println("浮点数相加");

        return  dnuma + dnumb;
    }


    public static void sum(int numa ,int numb ,int numc){

        int result = numa + numb + numc;
        System.out.println("result : "+result);
        // return  ;
    }

    public static int sum(int numa ,int numb ,int numc,int numd){
        return  numa + numb + numc + numd;
    }


    public static void main(String args[]){

        System.out.println("sum(10,20) = " + sum(10, 20));
        System.out.println("sum(10.0,20.0) = " + sum(10.0, 20.0));
        // System.out.println("sum(10,20,30) = " + sum(10, 20,30));
        sum(10, 20,30);
        System.out.println("sum(10,20,30.490) = " + sum(10, 20,30,40));

    }
}
